import os
import sys
import pytest

from common.time_bdp import time_bdp
from operation.folder import folder_newtree, folder_delete

BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(BASE_PATH)


# @pytest.fixture(scope="function")
# def testcase_data(request):
#     testcase_name = request.function.__name__
#     return user_test_data.get(testcase_name)


@pytest.fixture(scope="module")
def env_clear():
    '''
    删除所在域的下面所有的工作表文件夹
    '''
    print("是否会执行清理动作")
    # _t = time_bdp.time_stamp_13()
    # _xsrf = ""
    # tree_type = "0"
    # tb_id = ""
    # folder_list = []
    # folder_newtree_result = folder_newtree(get_access_token,_t,_xsrf,tree_type,tb_id,folder_list)
    # #获取所有的工作表文件夹id
    # folder_newtree_payload = folder_newtree_result.payload
    # folder_id_list = folder_newtree_payload["result"]["folder_list"]
    # for folder_id in folder_id_list:
    #     really_folder_id = folder_id["folder_id"]
    #     if really_folder_id == "folder_root":
    #         pass
    #     else:
    #         mode = "0"
    #         folder_delete(get_access_token,really_folder_id,mode)